package com.chenshuang.web;

import com.chenshuang.bean.Student;
import com.chenshuang.dao.StudentDao;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "StuMessageServlet", value = "/StuServlet")
public class StuMessageServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        StudentDao studentDao = new StudentDao();
        List<Student> list = studentDao.addquerystudent();
        request.setAttribute("list",list);

        request.getRequestDispatcher("WEB-INF/message.jsp").forward(request,response);
    }
}
